package com.example.xmind2testcase.pojo.vo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CaseVo {
    private String title;
    private String designer;
    private String caseDesignPhare;
    private String caseType;
    private List<Step> steps;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDesigner() {
        return designer;
    }

    public void setDesigner(String designer) {
        this.designer = designer;
    }

    public String getCaseDesignPhare() {
        return caseDesignPhare;
    }

    public void setCaseDesignPhare(String caseDesignPhare) {
        this.caseDesignPhare = caseDesignPhare;
    }

    public String getCaseType() {
        return caseType;
    }

    public void setCaseType(String caseType) {
        this.caseType = caseType;
    }

    public ArrayList<Map<String,String>> getSteps() {
        ArrayList<Map<String,String>> maps = new ArrayList<>();
        for(Step step:this.steps){
            HashMap<String, String> stringStringHashMap = new HashMap<>();
            String step1 = step.getStep();
            String result = step.getResult();
            stringStringHashMap.put("step",step1);
            stringStringHashMap.put("result",result);
            maps.add(stringStringHashMap);

        }
        return maps;
    }

    public void setSteps(List<Step> steps) {
        this.steps = steps;
    }



    @Override
    public String toString() {
        return "TestcaseVo{" +
                "title='" + title + '\'' +
                ", designer='" + designer + '\'' +
                ", caseDesignPhare='" + caseDesignPhare + '\'' +
                ", caseType='" + caseType + '\'' +
                ", steps=" + steps +
                '}';
    }

    static class Step{
        String step;
        String result;

        public String getStep() {
            return step;
        }

        public void setStep(String step) {
            this.step = step;
        }

        public String getResult() {
            return result;
        }

        public void setResult(String result) {
            this.result = result;
        }

        @Override
        public String toString() {
            return "Steps{" +
                    "step='" + step + '\'' +
                    ", result='" + result + '\'' +
                    '}';
        }
    }
}
